Encoding:

P32A

001000

rt

rs

rd

SHRAV.PH

0

0110001

101

P32A

001000

rt

rs

rd

SHRAV_R.PH

1

0110001

101

6

5

5

5

1

7

3

Format:

SHRAV[_R].PH 

Shift Right Arithmetic Variable Vector Pair Halfwords

SHRAV.PH   rd, rt, rs

DSP

Shift Right Arithmetic Variable Vector Pair Halfwords

SHRAV_R.PH rd, rt, rs

DSP

Shift Right Arithmetic Variable Vector Pair Halfwords

Purpose:

Shift Right Arithmetic Variable Vector Pair Halfwords

Element-wise arithmetic right shift of two independent halfwords in a vector data type by a variable number of bits, with optional rounding.

Description:

rd = rnd16(rt31..16 >> rs3..0) || rnd16(rt15..0 >> rs3..0)

The two halfword values in register rt are each independently shifted right, with each value’s original sign bit duplicated into the most-significant bits emptied by the shift. In the non-rounding variant of this instruction, the two independent results are then written to the corresponding halfword elements of destination register rd.

In the rounding variant of this instruction, a 1 is added at the most-significant discarded bit position before the results are written to destination register rd.

The shift amount sa is given by the four least-significant bits of register rs; the remaining bits of rs are ignored.

Restrictions:

No data-dependent exceptions are possible.

The operands must be values in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.

Operation:

SHRAV.PH
   ValidateAccessToDSPResources()
   tempB15..0 = shift16RightArithmetic( GPR[rt]31..16, GPR[rs]3..0 )
   tempA15..0 = shift16RightArithmetic( GPR[rt]15..0, GPR[rs]3..0 )
   GPR[rd]31..0 = tempB15..0 || tempA15..0
SHRAV_R.PH
   ValidateAccessToDSPResources()
   tempB15..0 = rnd16ShiftRightArithmetic( GPR[rt]31..16, GPR[rs]3..0 )
   tempA15..0 = rnd16ShiftRightArithmetic( GPR[rt]15..0, GPR[rs]3..0 )
   GPR[rd]31..0 = tempB15..0 || tempA15..0

Exceptions:

Reserved Instruction, DSP Disabled